#ifndef __EMULATOR_H
#define __EMULATOR_H

#include"CPU.h"
#include"PPU.h"
#include"Controller.h"
#include"Mapper.h"

typedef struct __EMULATOR
{
	CPU cpu;
	PPU ppu;
	CARTRIDGEBOARD cart;
	CONTROLLER controller;
	MAPPER *mapper;
	unsigned int LastTick, CurrentTick;
	bool IRQ_INTERNAL_SIGNAL, NMI_INTERNAL_SIGNAL;
	bool init;
	bool (*reset)(struct __EMULATOR*);
	void (*run)(struct __EMULATOR*);

}EMULATOR;

void EMULATORInit(EMULATOR *);
void EMULATORFree(EMULATOR*);
void EMULATORSave(EMULATOR*,PCTSTR szFileName);
bool EMULATORRecover(EMULATOR*, PCTSTR szFileName);


#endif /*__EMULATOR_H*/

